﻿using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace Himp.Outpatient.EntityFrameworkCore;

[ConnectionStringName(OutpatientDbProperties.ConnectionStringName)]
public class OutpatientDbContext : AbpDbContext<OutpatientDbContext>, IOutpatientDbContext
{
    #region 门诊排班

    /// <summary>
    /// 门诊排班类别
    /// </summary>
    public DbSet<OtpSchdType> OtpSchdTypes { get; set; }

    /// <summary>
    /// 门诊排班时段
    /// </summary>
    public DbSet<OtpSchdPeriod> OtpSchdPeriods { get; set; }

    /// <summary>
    /// 门诊排班计划
    /// </summary>
    public DbSet<OtpSchdPlan> OtpSchdPlans { get; set; }

    /// <summary>
    /// 门诊排班记录
    /// </summary>
    public DbSet<OtpSchdRec> OtpSchdRecs { get; set; }

    /// <summary>
    /// 门诊排班记录详细
    /// </summary>
    public DbSet<OtpSchdRecDetl> OtpSchdRecDetls { get; set; }

    #endregion

    #region 门诊设置

    public DbSet<OtpSetlType> OtpSetlTypes { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpOperRm> OtpOperRms { get; set; }

    #endregion

    #region 门诊导诊

    public DbSet<OtpQueueRec> OtpQueueRecs { get; set; }

    public DbSet<OtpWkstLoginRec> WkstLoginRecs { get; set; }

    #endregion

    #region 门诊挂号

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpRgstType> OtpRgstTypes { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpRgstRec> OtpRgstRecs { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpRgstTypeAssocPubItem> OtpRgstTypeAssocPubItems { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpRgstOrd> OtpRgstOrds { get; set; }

    #endregion

    #region 门诊订单

    public DbSet<OtpOrdRec> OtpOrdRecs { get; set; }

    public DbSet<OtpOrdDetl> OtpOrdDetls { get; set; }

    public DbSet<OtpOrdFeeDetl> OtpOrdFeeDetls { get; set; }

    public DbSet<OtpPayRec> OtpPayRecs { get; set; }

    public DbSet<OtpPayWay> OtpPayWays { get; set; }

    #endregion

    #region 门诊就诊

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpMdtrtRec> OtpMdtrtRecs { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpDiagRec> OtpDiagRecs { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpRxType> OtpRxTypes { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpRxRec> OtpRxRecs { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpRxRecDetl> OtpRxRecDetls { get; set; }

    public DbSet<OtpRxOrd> OtpRxOrds { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<OtpMdtrtAssocOrd> OtpMdtrtAssocOrds { get; set; }

    /// <summary>
    /// 门诊申请单
    /// </summary>
    public DbSet<OtpAppyForm> OtpAppyForms { get; set; }

    /// <summary>
    /// 门诊申请单明细
    /// </summary>
    public DbSet<OtpAppyFormDetl> OtpAppyFormDetls { get; set; }

    #endregion

    #region 门诊发票

    public DbSet<InvoUsedRec> InvoUsedRecs { get; set; }

    public DbSet<OtpInvo> OtpInvos { get; set; }

    #endregion

    public OutpatientDbContext(DbContextOptions<OutpatientDbContext> options)
        : base(options)
    {

    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        builder.ConfigureOutpatient();
    }
}
